'''
Created on 2009-11-11

@author: dell
'''
import json
from mod.tpl import Tpl
class JsonOut(Tpl):
    '''
    classdocs
    '''


    def stateDirt(self,state,msg):
        _dirt = {}
        _dirt['state'] = state
        _dirt['msg'] = msg
        self.jsonOut(_dirt)
           
    def jsonOut(self,dirt):
        jsondata = json.write(dirt)
        self.response.out.write(jsondata)
        exit
    def displayError(self,err):
        self.response.out.write(err)
        